<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">

	<ul class="nav nav-tabs">
        <li ><a class="nav-link" href="{:url('case/zhaopinAdd')}">添加贤士</a></li>
        <li ><a  href="{:url('case/zhaopinIndex')}">招纳贤士列表</a></li> 
        <li class="active"><a  href="{:url('case/zhaopinIndex')}">编辑贤士</a></li>    
    </ul>
    
	<div class="row">
		<div class="col-md-12">
			<div class="card-body">
			
			    <form action="{:url('Case/zhaopinEditPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
			        <div class="row">
			            <div class="col-md-9">
			                <table class="table table-bordered">
			                    <tr>
                                    <input type="hidden" name='post[id]' value="{$data.id}">
			                        <th style="width: 100px;text-align:center;">职位名称：</th>
			                        <td style='text-align:center;'>
			                            <input class="form-control" type="text" style="width:260px;" name="post[title]" id="title"
			                                    value="{$data.title}" placeholder=""/>
			                        </td>
			                    </tr>
			                    <tr>
			                        <th style="width: 100px;text-align:center;">发布人：</th>
			                        <td style='text-align:center;'>
			                            <input class="form-control" type="text" name="post[add_user_name]" id="keywords" value="{$data.add_user_name}"
			                                   style="width: 260px" placeholder="">
			                        </td>
			                    </tr>
			                    <tr>
			                         <th style="width: 100px;text-align:center;">职位简介：</th> 
                                    <td><textarea class="form-control"  rows='3' style='width:500px;' name="post[content]">{$data.content}</textarea></td>
			                    </tr>

                                 <tr>
                                     <th style="width: 100px;text-align:center;">职位详情：</th>
                                    <td> <script type="text/plain" id="content" name="post[desc]">{$data.desc}</script></td>
                                </tr>
                              
			                   
			                </table>
			            </div>
			        </div>
			        <div class="form-group">
			            <div class="col-sm-offset-2 col-sm-10">
			             
			                <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('EDIT')}</button>
			                <a class="btn btn-default" href="{:url('case/zhaopinIndex')}">{:lang('BACK')}</a>
			            </div>
			        </div>
			    </form>

			</div>
		</div>
	</div>
</div>
</body>
<block name="script">

<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
    $(function () {

        editorcontent = new baidu.editor.ui.Editor();
        editorcontent.render('content');
        try {
            editorcontent.sync();
        } catch (err) {
        }

        $('.btn-cancel-thumbnail').click(function () {
            $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
            $('#thumbnail').val('');
        });

    });

    function company() {
        $('#project_p').html('');

        openIframeLayer("{:url('Company/find')}", '公司查找', {
            area: ['700px', '400px'],
            btn: ['确定', '取消'],
            yes: function (index, layero) {

                var iframeWin          = window[layero.find('iframe')[0]['name']];
                var all = iframeWin.confirm();

                $('#company_name').val(all.company_name);
                $('#company_id').val(all.company_id);


                //项目查找
                $.ajax({
                    type:'get',
                    url : "{:url('project/search')}?company_id="+all.company_id,
                    dataType:'json',
                    success:function(data)
                    {
                        var data = data.data;
                        if(data.length == 0)
                        {   
                            $('#project_p').html("<lable style='color:red;'>&nbsp;&nbsp;*该公司暂无项目信息,如需要则去项目管理添加<lable>");

                        }else
                        {
                            var str = '';
                            for(var i = 0;i<data.length;i++)
                            {
                                str += "<input type='checkbox' name='all_project[]' value="+data[i]['id']+"> "+data[i]['project_name']+"  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                            }
                            $('#project_p').html(str);
                        }
                    }
                })
                layer.close(index); //如果设定了yes回调，需进行手工关闭
            }
        });
    }

    //  function project() {

    //     openIframeLayer("{:url('project/find')}", '项目查找', {
    //         area: ['700px', '400px'],
    //         btn: ['确定', '取消'],
    //         yes: function (index, layero) {

    //             var iframeWin          = window[layero.find('iframe')[0]['name']];
    //             var all = iframeWin.confirm();

    //             $('#project_id').val(all.project_id);
    //             $('#project_name').val(all.project_name);
    //             layer.close(index); //如果设定了yes回调，需进行手工关闭
    //         }
    //     });
    // }
</script>
</block>